<template>
	<view class="container">
		<view class="back-to-top" :class="{ 'show-back-top': showBackTop }" @tap="scrollToTop">
			<image
				src="https://hedashepin.oss-cn-guangzhou.aliyuncs.com/upload/3/20250308/7c1cce16799e556a5b8bd4ff1ad0bb58.png"
				mode="aspectFit"></image>
		</view>
		<block v-if="isload">
			<block v-if="cartlist.length > 0">
				<view class="cartmain">
					<block v-for="(item, index) in cartlist" :key="item.bid">
						<view class="item">
							<!--<view class="btitle">
							<view @tap.stop="changeradio" :data-index="index" class="radio" :style="item.checked ? 'background:'+t('color1')+';border:0' : ''"><image class="radio-img" src="/static/img/checkd.png"/></view>
							<view class="btitle-name" @tap="goto" :data-url="'/pagesExt/business/index?id=' + item.business.id">{{item.business.name}}</view>
							<view class="flex1"> </view>
							<view class="btitle-del" @tap="cartdeleteb" :data-bid="item.bid"><image class="img" src="/static/img/del.png"/><text style="margin-left:10rpx">删除</text></view>
						</view>-->
							<view class="content" v-for="(item2, index2) in item.prolist" @tap="goto"
								:data-url="'/pages/shop/product?id=' + item2.product.id" :key="index2">
								<view @tap.stop="changeradio2" :data-index="index" :data-index2="index2" class="radio"
									:style="item2.checked ? 'background:' + t('color1') + ';border:0' : ''">
									<image class="radio-img" src="/static/img/checkd.png" />
								</view>
								<view class="proinfo" :style="(item.prolist).length == index2 + 1 ? 'border:0' : ''">
									<image :src="item2.guige.pic ? item2.guige.pic : item2.product.pic" class="img" />
									<view class="detail">
										<view class="title"><text>{{ item2.product.name }}</text></view>
										<view class="desc"><text>{{ item2.guige.name }}</text></view>

										<view class="price">
											<view class="" :style="{ color: t('color1') }">
												<text style="font-size:24rpx">￥</text>
												<text>{{ item2.guige.sell_price }}</text>
											</view>
											<view class="" style="text-decoration: line-through;">
												<text style="font-size:24rpx">￥</text>
												<text>{{ item2.guige.sell_price }}</text>
											</view>
										</view>

										<view class="addnum">
											<view class="minus" :style="{background:t('color1')}" @tap.stop="gwcminus"
												:data-index="index" :data-index2="index2" :data-cartid="item2.id"
												:data-num="item2.num" :data-limit_start="item2.product.limit_start"
												:data-limit_start_guige="item2.guige.limit_start">
												<text class="minus-text">-</text>
												<!-- <image class="img" src="/static/img/cart-minus.png" /> -->
											</view>
											<input class="input" @tap.stop="" type="number" :value="item2.num"
												@blur="gwcinput" :data-max="item2.guige.store_nums" :data-index="index"
												:data-index2="index2" :data-cartid="item2.id" :data-num="item2.num"
												:data-limit_start="item2.product.limit_start"
												:data-limit_start_guige="item2.guige.limit_start"></input>
											<view class="plus" :style="{background:t('color1')}" @tap.stop="gwcplus"
												:data-index="index" :data-index2="index2"
												:data-max="item2.guige.store_nums" :data-num="item2.num"
												:data-cartid="item2.id" :data-limit_start="item2.product.limit_start"
												:data-limit_start_guige="item2.guige.limit_start">
												<text class="minus-text">+</text>
												<!-- <image class="img" src="/static/img/cart-plus.png" /> -->
											</view>
										</view>
									</view>
									<view class="prodel" @tap.stop="cartdelete" :data-cartid="item2.id">
										<image class="prodel-img" src="/static/img/del.png" />
									</view>
								</view>
							</view>
						</view>
					</block>
				</view>
			</block>
			<block v-if="cartlist.length <= 0">
				<view class="data-empty">
					<image :src="static_url + '/static/img/cartnull.png'" class="data-empty-img"
						style="width:120rpx;height:120rpx" />
					<view class="data-empty-text" style="margin-top:20rpx;font-size:24rpx">购物车空空如也~</view>
					<view
						style="width:400rpx;border:0;height:80rpx;line-height:80rpx;margin:40rpx auto;border-radius:6rpx;color:#fff"
						:style="{ background: t('color2') }" @tap="goto" :data-url="indexurl" data-opentype="reLaunch">
						去选购
					</view>
				</view>
			</block>
		</block>
		<block v-if="datalist.length>0">
			<view class="like">
				<image class="like-icon"
					src="https://hedashepin.oss-cn-guangzhou.aliyuncs.com/upload/3/20250407/1086317011f641d4dd9fc9a67b24ca9e.png"
					mode=""></image>
				<text>猜你喜欢</text>
			</view>
			<scroll-view class="classify-box" scroll-y="true" @scrolltolower="scrolltolower">
				<view class="product-itemlist">
					<view class="item" v-for="(item, index) in datalist" :key="index"
						:data-url="'/pages/shop/product?id=' + item.id" @click="goto">
						<image class="shop-image" :src="item.pic" mode="widthFix"></image>
						<view class="shop-text">
							<view class="shop-text-left">
								<view class="shop-text-name">
									{{ item.name }}
								</view>
								<view class="shop-text-price">
									<view class="">
										￥{{ item.sell_price }}
									</view>
									<view class="shop-text-sales">
										销量:{{item.sales}}
									</view>
								</view>
							</view>
							<view class="">
								<image class="shop-add"
									src="https://hedashepin.oss-cn-guangzhou.aliyuncs.com/upload/3/20250402/09cf0a1a6c7c2efd061d325e7722f543.png"
									mode=""></image>
							</view>
						</view>
					</view>
				</view>
				<nomore text="没有更多商品了" v-if="nomore"></nomore>
				<nodata text="暂无相关商品" v-if="nodata"></nodata>
				<view style="width:100%;height:140rpx"></view>
			</scroll-view>
		</block>

		<loading v-if="loading"></loading>
		<block v-if="cartlist.length > 0">
			<view style="height:auto;position:relative">
				<view style="width:100%;height:110rpx"></view>
				<view class="footer flex" :class="menuindex > -1 ? 'tabbarbot' : 'notabbarbot'">
					<view @tap.stop="changeradioAll" class="radio"
						:style="allchecked ? 'background:' + t('color1') + ';border:0' : ''">
						<image class="radio-img" src="/static/img/checkd.png" />
					</view>
					<view @tap.stop="changeradioAll" class="text0">全选
						（{{ selectedcount }}）
						<view class="btitle-del" @tap="cartdeleteb" :data-bid="bid"><text
								style="margin-left:10rpx">删除</text></view>
					</view>
					<view class="flex1"></view>
					<view class="text1">合计：</view>
					<block v-if="showprice_dollar">
						<view class="text2" style="font-size: 32rpx;"><text style="font-size:20rpx">$</text>{{
							usdtotalprice }}</view>
						<view class="text3"><text style="font-size:18rpx">￥</text>{{ totalprice }}</view>
					</block>
					<block v-else>
						<view class="text2"><text style="font-size:20rpx">￥</text>{{ totalprice }}</view>
					</block>



					<view class="op" :style="{ background: t('color1') }" @tap="toOrder">去结算</view>
				</view>
			</view>
		</block>
		<dp-tabbar :opt="opt" @getmenuindex="getmenuindex"></dp-tabbar>
		<popmsg ref="popmsg"></popmsg>
	</view>
</template>

<script>
	var app = getApp();
	export default {
		data() {
			return {
				opt: {},
				loading: false,
				isload: false,
				menuindex: -1,
				pre_url: app.globalData.pre_url,
				static_url: app.globalData.static_url,
				indexurl: app.globalData.indexurl,
				cartlist: [],
				tjdatalist: [],
				totalprice: '0.00',
				selectedcount: 0,
				allchecked: true,
				showprice_dollar: false,
				usdrate: 0,
				usdtotalprice: 0,
				bid: 0,
				datalist: [],
				nomore: false,
				nodata: false,
				page: 1,
				pageSize: 10,
				hasMore: true,
				isLoading: false,
				showBackTop: false,
			};
		},

		onLoad: function(opt) {
			this.opt = app.getopts(opt);
			this.getlist()
		},
		onShow: function() {
			this.getdata();
		},
		onReachBottom: function() {
			if (this.hasMore) {
				this.page++; // 页码+1
				this.getlist(); // 加载下一页
			}
		},
		onPullDownRefresh: function() {
			this.getdata();
		},
		onShareAppMessage: function() {
			var that = this;
			var cartlist = that.cartlist;
			var ids = [];
			var prodata = '';
			for (var i in cartlist) {
				for (var j in cartlist[i].prolist) {
					if (cartlist[i].prolist[j].checked) {
						var thispro = cartlist[i].prolist[j];
						var tmpprostr = thispro.id;
						prodata += tmpprostr + '|';
					}
				}
			}
			this.opt.cartid = encodeURIComponent(prodata)

			var scene = [];
			for (var i in this.opt) {
				if (i != 'pid') {
					scene.push(i + '_' + this.opt[i]);
				}
			}
			console.log(app.globalData.mid);
			if (app.globalData.mid) {
				scene.push('pid_' + app.globalData.mid);
			}
			var scenes = scene.join('-');
			var sharelink = '/pages/shop/sharecart' + "?scene=" + scenes + '&t=' + parseInt((new Date().getTime()) /
				1000);;
			return this._sharewx({
				link: sharelink
			});
		},
		onShareTimeline: function() {
			var that = this;
			var cartlist = that.cartlist;
			var ids = [];
			var prodata = '';
			for (var i in cartlist) {
				for (var j in cartlist[i].prolist) {
					if (cartlist[i].prolist[j].checked) {
						var thispro = cartlist[i].prolist[j];
						var tmpprostr = thispro.id;
						prodata += tmpprostr + '|';
					}
				}
			}
			this.opt.cartid = encodeURIComponent(prodata)

			var scene = [];
			for (var i in this.opt) {
				if (i != 'pid') {
					scene.push(i + '_' + this.opt[i]);
				}
			}
			console.log(app.globalData.mid);
			if (app.globalData.mid) {
				scene.push('pid_' + app.globalData.mid);
			}
			var scenes = scene.join('-');
			var sharelink = '/pages/shop/sharecart' + "?scene=" + scenes + '&t=' + parseInt((new Date().getTime()) /
				1000);;

			var sharewxdata = this._sharewx();
			var query = (sharewxdata.path).split('?')[1] + '&seetype=circle';
			console.log(sharewxdata)
			console.log(query)
			return {
				title: sharewxdata.title,
				imageUrl: sharewxdata.imageUrl,
				query: query
			}
		},
		onPageScroll(e) {
			const scrollTop = e.scrollTop;
			this.showBackTop = scrollTop > 500;
		},
		methods: {
			scrollToTop() {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300
				});
			},
			getlist() {
				// 如果没有更多数据或正在加载，则直接返回
				if (!this.hasMore || this.isLoading) return;

				this.isLoading = true; // 开始加载
				const that = this;

				app.get('Shop/guessLikeProduct', {
					page: this.page,
					pagelimit: this.pageSize
				}, function(res) {
					that.isLoading = false; // 加载完成

					if (res.status == 200) {
						// 如果是第一页，直接赋值；否则追加数据
						if (that.page === 1) {
							if (res.data.length >= 10) {
								that.datalist = res.data;
							} else {
								that.datalist = [...that.datalist, ...res.data];
								that.page = 2;
								that.getlist()
							}
						} else {
							that.datalist = [...that.datalist, ...res.data];
						}

						// 判断是否还有更多数据
						that.hasMore = res.data.length >= that.pageSize;
					} else {
						app.error(res.msg);
					}
				});
			},

			getdata: function() {
				var that = this;
				var bid = that.opt.bid ? that.opt.bid : '';
				if (bid) {
					that.indexurl = 'pagesExt/business/index?id=' + bid;
				}

				var cachearea = app.getCache('user_current_area');
				var cachelongitude = app.getCache('user_current_longitude');
				var cachelatitude = app.getCache('user_current_latitude');
				that.loading = true;
				app.get('Shop/cart', {
					bid: bid,
					area: cachearea,
					latitude: cachelatitude,
					longitude: cachelongitude
				}, function(res) {
					that.loading = false;
					that.cartlist = res.cartlist;
					that.showprice_dollar = res.price_dollar
					that.usdrate = res.usdrate
					that.calculate();
					that.loaded();
				});
			},
			calculate: function() {
				var that = this;
				var cartlist = that.cartlist;
				var ids = [];
				var totalprice = 0.00;
				var selectedcount = 0;
				for (var i in cartlist) {
					for (var j in cartlist[i].prolist) {
						if (cartlist[i].prolist[j].checked) {
							ids.push(cartlist[i].prolist[j].id);
							var thispro = cartlist[i].prolist[j];
							totalprice += thispro.guige.sell_price * thispro.num;
							selectedcount += thispro.num;
						}
					}
				}

				that.totalprice = totalprice.toFixed(2);

				if (that.showprice_dollar && that.usdrate) {
					that.usdtotalprice = (totalprice / that.usdrate).toFixed(2);
				}

				that.selectedcount = selectedcount;
			},
			changeradio: function(e) {
				var that = this;
				var index = e.currentTarget.dataset.index;
				var type = e.currentTarget.dataset.type ? e.currentTarget.dataset.type : '';
				if (type == 2) {

				} else {
					var cartlist = that.cartlist;
					var checked = cartlist[index].checked;
					if (checked) {
						cartlist[index].checked = false;
					} else {
						cartlist[index].checked = true;
					}
					for (var i in cartlist[index].prolist) {
						cartlist[index].prolist[i].checked = cartlist[index].checked;
					}
					that.cartlist = cartlist;
				}
				that.calculate();
			},

			changeradio2: function(e) {
				var that = this;
				var type = e.currentTarget.dataset.type ? e.currentTarget.dataset.type : '';
				var index = e.currentTarget.dataset.index;
				var index2 = e.currentTarget.dataset.index2;
				if (!type) {
					var cartlist = that.cartlist;
					var checked = cartlist[index].prolist[index2].checked;
					if (checked) {
						cartlist[index].prolist[index2].checked = false;
					} else {
						cartlist[index].prolist[index2].checked = true;
					}
					var isallchecked = true;
					for (var i in cartlist[index].prolist) {
						if (cartlist[index].prolist[i].checked == false) {
							isallchecked = false;
						}
					}
					if (isallchecked) {
						cartlist[index].checked = true;
					} else {
						cartlist[index].checked = false;
					}
					that.cartlist = cartlist;
				}

				that.calculate();
			},
			changeradioAll: function() {
				var that = this;
				var cartlist = that.cartlist;
				var allchecked = that.allchecked
				for (var i in cartlist) {
					cartlist[i].checked = allchecked ? false : true;
					for (var j in cartlist[i].prolist) {
						cartlist[i].prolist[j].checked = allchecked ? false : true;
					}
				}
				that.cartlist = cartlist;

				that.allchecked = allchecked ? false : true;
				that.calculate();
			},
			cartdelete: function(e) {
				var that = this;
				var id = e.currentTarget.dataset.cartid;
				var type = e.currentTarget.dataset.type ? e.currentTarget.dataset.type : '';
				app.confirm('确定要从购物车移除吗?', function() {
					app.post('Shop/cartdelete', {
						id: id,
						type: type
					}, function(data) {
						app.success(data.msg);
						if (data.status == 1) {
							setTimeout(function() {
								that.getdata();
							}, 1000);
						}
					});
				});
			},
			cartdeleteb: function(e) {
				var that = this;
				var bid = e.currentTarget.dataset.bid;
				var type = e.currentTarget.dataset.type ? e.currentTarget.dataset.type : '';

				app.confirm('确定要从购物车移除吗?', function() {
					app.post('Shop/cartdelete', {
						bid: bid,
						type: type
					}, function(data) {
						app.success('操作成功');
						setTimeout(function() {
							that.getdata();
						}, 1000);
					});
				});
			},
			toOrder: function() {
				var that = this;
				var cartlist = that.cartlist;
				var prodata = [];

				for (var i in cartlist) {
					for (var j in cartlist[i].prolist) {
						if (cartlist[i].prolist[j].checked) {
							var thispro = cartlist[i].prolist[j];
							// 构建参数：product.id,guige.id,num,commerce_mid[,glassrecord.id]
							var tmpprostr = [
								thispro.product.id,
								thispro.guige.id,
								thispro.num,
								thispro.commerce_mid || '0',
								thispro.commerce_type
							].join(',');

							// 如果有glassrecord，追加到参数
							if (thispro.glassrecord) {
								tmpprostr += ',' + thispro.glassrecord.id;
							}

							prodata.push(tmpprostr);
						}
					}
				}

				if (prodata.length == 0) {
					app.error('请先选择产品');
					return;
				}

				// 构建最终URL参数
				var urlParams = 'prodata=' + prodata.join('-');
				app.goto('buy?' + urlParams);
			},
			//加
			gwcplus: function(e) {
				var type = e.currentTarget.dataset.type ? e.currentTarget.dataset.type : '';
				var index = parseInt(e.currentTarget.dataset.index);
				var index2 = parseInt(e.currentTarget.dataset.index2);
				var cartid = e.currentTarget.dataset.cartid;

				var num = parseInt(e.currentTarget.dataset.num);
				if (!type) {
					var maxnum = parseInt(e.currentTarget.dataset.max);
					if (num >= maxnum) {
						app.error('库存不足');
						return;
					}
					var cartlist = this.cartlist;
					cartlist[index].prolist[index2].num++;
					this.cartlist = cartlist
				}

				this.calculate();
				var that = this;
				app.post('Shop/cartChangenum', {
					id: cartid,
					num: num + 1,
					type: type
				}, function(data) {
					if (data.status == 1) {
						//that.getdata();
					} else {
						app.error(data.msg);
						if (!type) {
							cartlist[index].prolist[index2].num--;
						}
					}
				});
			},
			//减
			gwcminus: function(e) {
				var type = e.currentTarget.dataset.type ? e.currentTarget.dataset.type : '';
				var index = parseInt(e.currentTarget.dataset.index);
				var index2 = parseInt(e.currentTarget.dataset.index2);
				var cartid = e.currentTarget.dataset.cartid;

				var num = parseInt(e.currentTarget.dataset.num);
				if (num == 1) return;
				if (!type) {
					var maxnum = parseInt(e.currentTarget.dataset.max);
					var limit_start = parseInt(e.currentTarget.dataset.limit_start);
					var limit_start_guige = parseInt(e.currentTarget.dataset.limit_start_guige);
					if (limit_start_guige > 0 && num <= limit_start_guige) {
						app.error('该商品规格' + limit_start_guige + '件起售');
						return;
					}
					if (limit_start > 0 && num <= limit_start) {
						app.error('该商品' + limit_start + '件起售');
						return;
					}
					var cartlist = this.cartlist;
					cartlist[index].prolist[index2].num--;
					this.cartlist = cartlist
					this.calculate();
				}

				var that = this;
				app.post('Shop/cartChangenum', {
					id: cartid,
					num: num - 1,
					type: type
				}, function(data) {
					if (data.status == 1) {
						//that.getdata();
					} else {
						app.error(data.msg);
						if (!type) {
							cartlist[index].prolist[index2].num++;
						}
					}
				});
			},
			//输入
			gwcinput: function(e) {
				var type = e.currentTarget.dataset.type ? e.currentTarget.dataset.type : '';
				var index = parseInt(e.currentTarget.dataset.index);
				var index2 = parseInt(e.currentTarget.dataset.index2);
				var maxnum = parseInt(e.currentTarget.dataset.max);
				var cartid = e.currentTarget.dataset.cartid;
				var num = e.currentTarget.dataset.num;
				var newnum = parseInt(e.detail.value);
				if (num == newnum) return;
				if (newnum < 1) {
					app.error('最小数量为1');
					return;
				}
				if (!type) {
					var limit_start = parseInt(e.currentTarget.dataset.limit_start);
					var limit_start_guige = parseInt(e.currentTarget.dataset.limit_start_guige);
					if (limit_start_guige > 0 && newnum < limit_start_guige) {
						app.error('该商品规格' + limit_start_guige + '件起售');
						return;
					}
					if (limit_start > 0 && newnum < limit_start) {
						app.error('该商品' + limit_start + '件起售');
						return;
					}
					if (newnum > maxnum) {
						app.error('库存不足');
						return;
					}
					var cartlist = this.cartlist;
					cartlist[index].prolist[index2].num = newnum;
					this.cartlist = cartlist
					this.calculate();
				}
				var that = this;
				app.post('Shop/cartChangenum', {
					id: cartid,
					num: newnum,
					type: type
				}, function(data) {
					if (data.status == 1) {
						//that.getdata();
					} else {
						app.error(data.msg);
					}
				});
			},
			addcart: function() {
				this.getdata();
			}
		}
	};
</script>
<style>
	.container {
		height: 100%
	}

	.cartmain .item {
		width: 94%;
		margin: 20rpx 3%;
		/* background: #fff; */
		border-radius: 20rpx;
		/* padding: 30rpx 3%; */
	}

	.cartmain .item .radio {
		flex-shrink: 0;
		width: 32rpx;
		height: 32rpx;
		background: #FFFFFF;
		border: 2rpx solid #BFBFBF;
		border-radius: 50%;
		margin-right: 30rpx
	}

	.cartmain .item .radio .radio-img {
		width: 100%;
		height: 100%
	}

	.cartmain .item .btitle {
		width: 100%;
		display: flex;
		align-items: center;
		margin-bottom: 30rpx
	}

	.cartmain .item .btitle-name {
		color: #222222;
		font-weight: bold;
		font-size: 28rpx;
	}

	.cartmain .item .btitle-del {
		display: flex;
		align-items: center;
		color: #999999;
		font-size: 24rpx;
	}

	.cartmain .item .btitle-del .img {
		width: 24rpx;
		height: 24rpx
	}

	.cartmain .item .content {
		width: 100%;
		position: relative;
		display: flex;
		align-items: center;
		margin-bottom: 20rpx;
		border-radius: 40rpx;
		box-shadow: 0 2rpx 6rpx 0 rgba(0, 0, 0, 0.4);
		padding: 20rpx;
	}

	.cartmain .item .content .proinfo {
		flex: 1;
		display: flex;
		padding: 20rpx 0;
		/* border-bottom: 1px solid #f2f2f2 */
	}

	.cartmain .item .content .proinfo .img {
		width: 176rpx;
		height: 176rpx;
		border-radius: 10rpx;
	}

	.cartmain .item .content .detail {
		flex: 1;
		margin-left: 20rpx;
		height: 176rpx;
		position: relative;
	}

	.cartmain .item .content .detail .title {
		color: #222222;
		font-weight: bold;
		font-size: 28rpx;
		line-height: 34rpx;
		margin-bottom: 0;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
		height: 68rpx
	}

	.cartmain .item .content .detail .desc {
		margin-top: 16rpx;
		height: 30rpx;
		line-height: 30rpx;
		color: #999;
		overflow: hidden;
		font-size: 20rpx;
	}

	.cartmain .item .content .prodel {
		width: 24rpx;
		height: 24rpx;
		position: absolute;
		top: 90rpx;
		right: 10rpx;
	}

	.cartmain .item .content .prodel-img {
		width: 100%;
		height: 100%
	}

	.cartmain .item .content .price {
		margin-top: 10rpx;
		height: 60rpx;
		font-size: 26rpx;
		font-weight: bold;
	}

	.cartmain .item .content .addnum {
		position: absolute;
		right: 0;
		bottom: 0rpx;
		font-size: 30rpx;
		color: #666;
		width: auto;
		display: flex;
		align-items: center
	}

	.cartmain .item .content .addnum .plus {
		width: 60rpx;
		height: 60rpx;
		background: #F6F8F7;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 10rpx;
	}

	.cartmain .item .content .addnum .minus {
		width: 60rpx;
		height: 60rpx;
		background: #F6F8F7;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 10rpx;
	}

	.cartmain .item .content .addnum .img {
		width: 24rpx;
		height: 24rpx
	}

	.cartmain .item .content .addnum .i {
		padding: 0 20rpx;
		color: #2B2B2B;
		font-weight: bold;
		font-size: 24rpx
	}

	.cartmain .item .content .addnum .input {
		flex: 1;
		width: 50rpx;
		border: 0;
		text-align: center;
		color: #2B2B2B;
		font-size: 24rpx;
		margin: 0 15rpx;
	}

	.cartmain .item .bottom {
		width: 94%;
		margin: 0 3%;
		border-top: 1px #e5e5e5 solid;
		padding: 10rpx 0px;
		overflow: hidden;
		color: #ccc;
		display: flex;
		align-items: center;
		justify-content: flex-end
	}

	.cartmain .item .bottom .f1 {
		display: flex;
		align-items: center;
		color: #333
	}

	.cartmain .item .bottom .f1 image {
		width: 40rpx;
		height: 40rpx;
		border-radius: 4px;
		margin-right: 4px
	}

	.cartmain .item .bottom .op {
		border: 1px #ff4246 solid;
		border-radius: 10rpx;
		color: #ff4246;
		padding: 0 10rpx;
		height: 46rpx;
		line-height: 46rpx;
		margin-left: 10rpx;
	}

	.footer {
		width: 100%;
		background: #fff;
		margin-top: 5px;
		position: fixed;
		left: 0px;
		bottom: 0px;
		z-index: 8;
		display: flex;
		align-items: center;
		padding: 0 20rpx;
		border-top: 1px solid #EFEFEF
	}

	.footer .radio {
		flex-shrink: 0;
		width: 32rpx;
		height: 32rpx;
		background: #FFFFFF;
		border: 2rpx solid #BFBFBF;
		border-radius: 50%;
		margin-right: 10rpx
	}

	.footer .radio .radio-img {
		width: 100%;
		height: 100%
	}

	.footer .text0 {
		color: #666666;
		font-size: 24rpx;
		display: contents;
	}

	.btitle-del text {
		color: #ba1f25
	}

	.footer .text1 {
		height: 110rpx;
		line-height: 110rpx;
		color: #444;
		font-weight: bold;
		font-size: 24rpx;
	}

	.footer .text2 {
		color: #F64D00;
		font-size: 36rpx;
		font-weight: bold
	}

	.footer .text3 {
		color: #F64D00;
		font-size: 28rpx;
		font-weight: bold
	}

	.footer .op {
		width: 200rpx;
		height: 76rpx;
		line-height: 76rpx;
		border-radius: 46rpx;
		font-weight: bold;
		color: #fff;
		font-size: 28rpx;
		text-align: center;
		margin-left: 30rpx
	}

	.xihuan {
		height: auto;
		overflow: hidden;
		display: flex;
		align-items: center;
		width: 100%;
		padding: 12rpx 160rpx
	}

	.xihuan-line {
		height: auto;
		padding: 0;
		overflow: hidden;
		flex: 1;
		height: 0;
		border-top: 1px solid #eee
	}

	.xihuan-text {
		padding: 0 32rpx;
		text-align: center;
		display: flex;
		align-items: center;
		justify-content: center
	}

	.xihuan-text .txt {
		color: #111;
		font-size: 30rpx
	}

	.xihuan-text .img {
		text-align: center;
		width: 36rpx;
		height: 36rpx;
		margin-right: 12rpx
	}

	.prolist {
		width: 100%;
		height: auto;
		padding: 8rpx 20rpx;
	}

	.data-empty {
		width: 100%;
		text-align: center;
		padding-top: 100rpx;
		padding-bottom: 100rpx
	}

	.data-empty-img {
		width: 300rpx;
		height: 300rpx;
		display: inline-block;
	}

	.data-empty-text {
		display: block;
		text-align: center;
		color: #999999;
		font-size: 32rpx;
		width: 100%;
		margin-top: 30rpx;
	}

	.minus-text {
		font-size: 34rpx;
	}

	.like {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.like-icon {
		width: 30rpx;
		height: 30rpx;
		margin-right: 10rpx;
	}

	.classify-box {
		flex: 1;
		overflow-y: auto;
		height: calc(100% - 94rpx);
		padding: 0 0 20rpx 0;
	}

	.classify-box .nav_right_items {
		width: 100%;
		border-bottom: 1px #f4f4f4 solid;
		padding: 16rpx 0;
		box-sizing: border-box;
		position: relative;
	}

	.product-itemlist {
		height: auto;
		position: relative;
		overflow: hidden;
		padding: 0 10rpx;
		display: flex;
		flex-wrap: wrap;
		box-sizing: border-box;
	}

	.product-itemlist .item {
		width: calc(50% - 40rpx);
		margin: 20rpx;
		position: relative;
		background: #fff;
		display: flex;
		flex-direction: column;
		overflow: hidden;
		border-radius: 40rpx;
		box-shadow: 0pt 4rpx 12rpx 0pt rgba(0, 0, 0, 0.4);
	}

	.product-itemlist .product-pic {
		width: 35%;
		height: 0;
		overflow: hidden;
		background: #ffffff;
		padding-bottom: 35%;
		position: relative;
		border-radius: 4px;
		margin-left: 14rpx;
		margin-top: 14rpx;
	}

	.product-itemlist .product-pic .image {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: auto
	}

	.shop-image {
		width: 100%;
		height: 268rpx;
	}

	.shop-text {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 6rpx 10rpx;
	}

	.shop-text-left {
		width: 80%;

	}

	.shop-text-name {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		font-weight: 700;
	}

	.shop-add {
		width: 30rpx;
		height: 30rpx;
	}

	.shop-text-price {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 20rpx;
	}

	.shop-text-sales {
		font-size: 24rpx;
	}

	.back-to-top {
		position: fixed;
		right: 30rpx;
		bottom: 400rpx;
		width: 80rpx;
		height: 80rpx;
		background: #fff;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 999;
		opacity: 0;
		transform: translateY(100rpx);
		transition: all 0.3s ease;
	}

	.back-to-top image {
		width: 40rpx;
		height: 40rpx;
	}

	.show-back-top {
		opacity: 1;
		transform: translateY(0);
	}
</style>